class Booking < ActiveRecord::Base
  belongs_to :campsite
  belongs_to :customer
  
  validates_presence_of :booking_date, :cust_id, :camp_id, :arrival_date, :nights, :adults
                        
  def validate
    errors.add(:total, "should be greater than 0") if total.nil? || total < 0.01
  end
end
